package com.laopan.wxpay.request.query;

import com.laopan.wxpay.WxConstants;
import com.laopan.wxpay.bean.result.OrderResult;
import com.laopan.wxpay.exception.WxPayException;
import com.laopan.wxpay.request.RequestCallback;

/**
 * @author laopan
 * @className WxOrderIdQuery
 * @date 2021/2/26 14:35
 */

public class WxOrderIdQuery implements
        QueryOrder<OrderResult> {

    private RealQueryOrder realQueryOrder;

    public WxOrderIdQuery(RealQueryOrder realQueryOrder) {

        this.realQueryOrder = realQueryOrder;
    }

    @Override
    public OrderResult query(String mchId, String id) throws WxPayException {
        return realQueryOrder.query(mchId, id, WxConstants.WX_QUERY_PATH);
    }

    @Override
    public OrderResult query(String mchId, String id, RequestCallback<OrderResult> requestCallback) throws WxPayException {
        return realQueryOrder.query(mchId, id, WxConstants.WX_QUERY_PATH, requestCallback);
    }
}
